<!--量算组件-->
<template>
  <div class="measure-panel">
    <button @click="start('distance')">测距</button>
    <button @click="start('area')">测面</button>
    <button @click="start('height')">测高</button>
    <button @click="clear">清除</button>
  </div>
</template>

<script setup lang="ts">
import { useMeasureStore } from '@/stores/supermap/useMeasureStore';
//调用存储在pinia中的方法
const store = useMeasureStore();

//使用量算功能
function start(type: 'distance' | 'area' | 'height') {
  store.startMeasure(type);
}

function clear() {
  store.clearMeasure();
}
</script>

<style scoped>
.measure-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 999;
}
</style>
